home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 176-200 / disk_183 / mklib / edlib / dectoint.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  371b  |  19 lines

  1. /* edlib  version 1.0 of 04/08/88 */
  2. /* this function takes a string of decimal digits and returns its value */
  3. #include <ctype.h>
  4.  
  5. int dectoint(number)
  6. char *number;
  7. {
  8.     int value = 0;
  9.  
  10.     while ( *number )
  11.         if ( isdigit(*number) ) {
  12.             value = value*10  + toint(*number++);
  13.         } else {
  14.             return(value);
  15.         }
  16.  
  17.     return(value);
  18. }
  19.